package nl.depository.pim.entities;

import java.util.HashMap;

import javax.persistence.Id;

public class Tag
{
	@Id
	private String id;
	
	private String name;
	
	private static HashMap<String, Tag> tags = new HashMap<String, Tag>();
	
	public static Tag forName(String tagName)
	{
		Tag tag;
		
		if (tags.containsKey(tagName))
		{
			tag = tags.get(tagName);
		}
		
		tag = new Tag(tagName);
		
		return tag;
	}
	
	private Tag(String name)
	{
		this.name = name;
	}
	
	public String getId()
	{
		return id;
	}
	
	public String getName()
	{
		return name;
	}
	
	@Override
	public Object clone() { return null; }
}
